package net.sudot.chess.business.service;

import net.sudot.chess.business.dao.PluginConfigDao;
import net.sudot.chess.business.model.PluginConfig;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * 插件配置
 *
 * @author tangjialin on 2018-03-18.
 */
@Service
public class PluginConfigService extends BaseService<PluginConfig> {

    @Resource
    private PluginConfigDao pluginConfigDao;

    public PluginConfig findByPluginId(String pluginId) {
        return pluginConfigDao.find("pluginId", pluginId);
    }

    @Transactional(rollbackFor = Exception.class)
    public void deleteByPluginId(String pluginId) {
        pluginConfigDao.remove("pluginId", pluginId);
    }

}
